package com.kaibes.module.account.pojo;

import java.time.LocalDateTime;

import com.kaibes.core.base.annotation.Description;
import com.kaibes.core.validator.LengthLimit;

import lombok.Data;

/**
CREATE TABLE `account` (
  `id` integer NOT NULL AUTO_INCREMENT,
  `username` varchar(16) NOT NULL,
  `password` varchar(64) NOT NULL,
  `user_id` integer DEFAULT NULL,
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
 */
@Description("账号信息")
@Data
public class Account {
    
    @Description("账号ID")
    private Integer id;
    @LengthLimit(min = 5, max = 32, message = "用户名最小5位，最大16位")
    @Description("用户名")
    private String username;
    @LengthLimit(min = 6, max = 32, message = "密码最小6位，最大32位")
    @Description("密码")
    private String password;
    @Description("用户ID")
    private Integer userId;
    @Description("创建时间")
    private LocalDateTime createTime;
    @Description("更新时间")
    private LocalDateTime updateTime;
    
}
